{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f04dd603-a2d1-48ce-8c17-9f1dba8de1ee",
   "metadata": {},
   "source": [
    "Chapter 04\n",
    "\n",
    "# 2 x 2方阵行列式对应平行四边形面积\n",
    "《线性代数》 | 鸢尾花书：数学不难"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ccafb456-2453-4c82-8a65-b1963a370cb2",
   "metadata": {},
   "source": [
    "好的，我们来重新从**行列式与面积的关系**这一角度，详细解释这段代码的数学意义。\n",
    "\n",
    "---\n",
    "\n",
    "设有二维矩阵 $A$：\n",
    "\n",
    "$$\n",
    "A = \\begin{bmatrix} 2 & 1 \\\\ 1 & 3 \\end{bmatrix}\n",
    "$$\n",
    "\n",
    "我们记其两列向量为：\n",
    "\n",
    "- $\\mathbf{a}_1 = \\begin{bmatrix} 2 \\\\ 1 \\end{bmatrix}$\n",
    "- $\\mathbf{a}_2 = \\begin{bmatrix} 1 \\\\ 3 \\end{bmatrix}$\n",
    "\n",
    "代码的核心目标是用图形方式**展示矩阵 $A$ 的行列式 $\\det(A)$ 对应的几何含义**：即由向量 $\\mathbf{a}_1$ 和 $\\mathbf{a}_2$ 构成的**平行四边形的有向面积**。\n",
    "\n",
    "---\n",
    "\n",
    "从数学上讲，二维空间中，两个向量 $\\mathbf{a}_1, \\mathbf{a}_2$ 构成的平行四边形，其面积为：\n",
    "\n",
    "$$\n",
    "\\text{Area} = |\\det(A)|\n",
    "$$\n",
    "\n",
    "而矩阵 $A$ 的行列式为：\n",
    "\n",
    "$$\n",
    "\\det(A) = 2 \\times 3 - 1 \\times 1 = 6 - 1 = 5\n",
    "$$\n",
    "\n",
    "因此，代码绘制出的黄色平行四边形，其面积正是 $|\\det(A)| = 5$。\n",
    "\n",
    "---\n",
    "\n",
    "平行四边形的四个顶点为：\n",
    "\n",
    "- $P_1 = \\mathbf{0}$（原点）\n",
    "- $P_2 = \\mathbf{a}_1$\n",
    "- $P_3 = \\mathbf{a}_1 + \\mathbf{a}_2$\n",
    "- $P_4 = \\mathbf{a}_2$\n",
    "\n",
    "这四点顺序围成了由 $\\mathbf{a}_1$ 和 $\\mathbf{a}_2$ 生成的平行四边形。其面积为：\n",
    "\n",
    "$$\n",
    "|\\mathbf{a}_1 \\times \\mathbf{a}_2| = |\\det(A)| = 5\n",
    "$$\n",
    "\n",
    "其中 $\\mathbf{a}_1 \\times \\mathbf{a}_2$ 是二维向量的“拟叉积”，其绝对值给出平面图形的有向面积。\n",
    "\n",
    "---\n",
    "\n",
    "从几何上看：\n",
    "\n",
    "- 红色箭头表示 $\\mathbf{a}_1$，\n",
    "- 绿色箭头表示 $\\mathbf{a}_2$，\n",
    "- 黄色阴影区域就是这两个向量生成的平行四边形，对应的面积即 $\\det(A)$。\n",
    "\n",
    "此外，`set_aspect('equal')` 保证图像不失真，面积视觉上真实地反映了几何意义。\n",
    "\n",
    "---\n",
    "\n",
    "因此，这段代码可视化的本质目的在于：  \n",
    "👉 **直观展示二维矩阵的行列式与面积之间的关系：行列式的绝对值即为其列向量生成的平行四边形的面积。**\n",
    "\n",
    "这不仅揭示了行列式的几何含义，也帮助理解线性变换对面积的缩放作用。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eab3426e-52e5-46c5-b23a-6c6762365b6b",
   "metadata": {},
   "source": [
    "## 初始化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4e44a355-6d42-4e4e-8088-31e28ff72477",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "04522686-55a9-46f5-a78f-3f254ed85e05",
   "metadata": {},
   "source": [
    "## 定义一个 2×2 的矩阵 A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "c0e1d643-b657-4d96-80f0-7c8b3d54380f",
   "metadata": {},
   "outputs": [],
   "source": [
    "A = np.array([[2, 1],\n",
    "              [1, 3]])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a31d6fb-2ed2-4840-86df-ccfcb9c5b80e",
   "metadata": {},
   "source": [
    "## 提取两列向量`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "8d2b0b5c-83ed-433a-b921-33832c25358c",
   "metadata": {},
   "outputs": [],
   "source": [
    "a1 = A[:, 0]  # 第一列向量\n",
    "a2 = A[:, 1]  # 第二列向量"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b16a5bf9-34c8-4dcc-8010-02d6da59050b",
   "metadata": {},
   "source": [
    "## 构建平行四边形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "5b086d86-ac76-410f-a92b-fadfcf04ff1b",
   "metadata": {},
   "outputs": [],
   "source": [
    "origin = np.array([0, 0])\n",
    "# 起点为原点\n",
    "P1 = origin\n",
    "P2 = a1\n",
    "P3 = a1 + a2\n",
    "P4 = a2\n",
    "parallelogram = np.array([P1, P2, P3, P4])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9503cf85-4c0b-4556-85cf-23089bfd4d9a",
   "metadata": {},
   "source": [
    "## 可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "2de41a7a-2376-4385-8fd2-2bcf79907c0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAGiCAYAAADOY4w6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAs7klEQVR4nO3de3BT95k38K9kS/Ld8lXYsnwBzP2ywQbi3JpwS0lKSLvJ2+22CXGStmBCYd192yb7x4ZOu87sdDLbmTS8ZttNoN3UmU5fEvZtQkyy3EJK1uYWCPcEsCz5bsnyBctwznn/ABlfBMG2js5POt/PDMNIWD7PD9lfDo+f3zkGRVEUEBGRsIxaF0BERLfHoCYiEhyDmohIcAx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AGXfvn1alxJWaWlpym9/+1uty1Bdd3e3UlxcrOzevVv52te+pmzcuHFMr4+YM+poNzAwgMOHD2PFihXDnl+xYgU++eQTjaqicAlce308V1aLRJIkoaamBr29vSgrK9O6HNWtX78ejz76KJYtWzau1wt1mVM9a29vhyRJsNlsw5632Wxobm7WqCoKB0VRUFlZifvuuw9z5szRuhxVnThxAmVlZejv70dSUhJ27NiBWbNmaV2WqmpqanDkyBHU1dWN+3Noekb98ssvw2Aw3PZXfX29liWGncFgGPZYUZRRz1F0eeGFF/DZZ5/hj3/8o9alqG769Ok4duwYDh06hHXr1mHNmjU4deqU1mWpxul0YuPGjfjDH/6AuLi4cX8eTc+oecnUmzIzMxETEzPq7Lm1tXXUWTZFjw0bNmDnzp3Yv38/8vLytC5HdWazGVOnTgUAlJaWoq6uDr/+9a9RXV2tcWXqOHz4MFpbW1FSUjL4nCRJ2L9/P1577TX4/X7ExMR85efRNKh5ydSbzGYzSkpKsHv3bnzzm98cfH737t1YvXq1hpWRGhRFwYYNG7Bjxw7s3btXt7ebUxRl2H1So83SpUtx4sSJYc+Vl5djxowZ+OlPf3pHIQ1EUI96opdMjQSVlZV46qmnUFpairKyMmzduhUNDQ1Yu3at1qWpqqenBxcuXBh8fPHiRRw7dgzp6enIz8/XsDL1rF+/Hm+99RbeffddJCcnD/5PKjU1FfHx8RpXp46XXnoJK1euhMPhQHd3N2pqarB3717s2rVL69JUk5ycPOrnDomJicjIyBjbzyNCP4iijjVr1igARv3as2eP1qWF1G9+8xuloKBAMZvNyoIFC3QxrrVnz56g7+2aNWu0Lk01wdYLQHnjjTe0Lk01zz777ODXdlZWlrJ06VKltrZW67LCbjzjebzMKRGR4DhHTUQkOAY1EZHgGNRERIJjUBMRCY5BTUQkOAY1EZHgGNRERIJjUBMRCY5BTUQkOAY1EZHgGNRERIL7/wpBHwNpXZObAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "\n",
    "# 绘制向量箭头\n",
    "ax.arrow(*origin, *a1, head_width=0.2, \n",
    "         length_includes_head=True, color='red')\n",
    "ax.arrow(*origin, *a2, head_width=0.2, \n",
    "         length_includes_head=True, color='green')\n",
    "\n",
    "# 绘制平行四边形\n",
    "ax.fill(parallelogram[:, 0], parallelogram[:, 1], \n",
    "        edgecolor = 'k', linestyle = '--',\n",
    "        alpha=0.3, facecolor='yellow')\n",
    "\n",
    "# 图像装饰\n",
    "ax.set_aspect('equal')\n",
    "ax.set_xlim(-1, max(P3[0], P2[0], P4[0]) + 1)\n",
    "ax.set_ylim(-1, max(P3[1], P2[1], P4[1]) + 1)\n",
    "ax.axhline(0, color='k', lw=1)\n",
    "ax.axvline(0, color='k', lw=1)\n",
    "ax.grid(True, color = '0.88')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "954b7525-dcef-47cb-af13-40c741ca3891",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "070c3389-8048-43a3-baa7-6666009bce96",
   "metadata": {},
   "source": [
    "作者\t**生姜DrGinger**  \n",
    "脚本\t**生姜DrGinger**  \n",
    "视频\t**崔崔CuiCui**  \n",
    "开源资源\t[**GitHub**](https://github.com/Visualize-ML)  \n",
    "平台\t[**油管**](https://www.youtube.com/@DrGinger_Jiang)\t\t\n",
    "\t\t[**iris小课堂**](https://space.bilibili.com/3546865719052873)\t\t\n",
    "\t\t[**生姜DrGinger**](https://space.bilibili.com/513194466)  "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:base] *",
   "language": "python",
   "name": "conda-base-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
